<!DOCTYPE html>
 <html>
 <head>
 	<title>无缝滚动</title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<link rel="stylesheet" type="text/css" href="style.css">
 </head>
 <body>
 	<div class="box">
 		<ul class="boxSonUl">
	 		<li>第一张图片</li>
	 		<li>第二张图片</li>
	 		<li>第三张图片</li>
	 		<li>第四张图片</li>
	 		<li>第五张图片</li>
	 		<li>第六张图片</li>
	 		<li>第七张图片</li>
	 		<li>第八张图片</li>
 		</ul>
 		<div class="boxArrow">
	 		<a href="javascript:;"> < </a>
	 		<a href="javascript:;"> > </a>
 		</div>
 	</div>
 </body>
 <script src="jquery-3.2.1.min.js"></script>
 <script type="text/javascript">
 $(function() {
 	var ulWidth = $('.boxSonUl').width();
 	function same(number){
 		if(number>0){
 			$('.boxSonUl').prepend($('.boxSonUl').find("li:last")).css({ marginLeft: -number }).animate({
 				'marginLeft':0
 			},'show');
 		}else{
 			$('.boxSonUl').animate({'marginLeft':number},'show',function(){
	 			$(this).append($(this).find("li:first")).css({ marginLeft: 0 });
	 		})
 		}
 	}
 	/*左移动*/
 	$('.boxArrow a:first-child').on('click',function(){
 		same(-100)
 	})
 	/*右移动*/
 	$('.boxArrow a:last-child').on('click',function(){
 		same(100)
 	})
 	/*定时器*/
 	var size=6;
 	var time=setInterval(function(){
 		same(-100);
 	},1000)
 	/*移入关闭定时器*/
 	$('.box').hover(function(){
 		clearInterval(time)
 	},function(){
 		time = setInterval(function(){
 		    same(-100);
 	    },1000)
 	})
  })
 /*
boxScorllFn = function (target,time) {
	
    var childrenWidth =0;
    target.children().each(function () {
        childrenWidth += $(this).outerWidth(true);
    });
    if(childrenWidth < target.width()){
        return false;
    }

    var targetChildrem_Width = 100;
    target.css('overflow','hidden');
	var size=6;
    setInterval(function(){

        target.prepend('<li>第'+size+'张图<>');
		size++
        target.animate({
            marginLeft:targetChildrem_Width
        },function () {
            target.scrollLeft(0);
            target.children(':last').remove();
        })

    },time);  
};   

boxScorllFn($('.boxSonUl'),2000)

 */
 </script>
 </html>